package ThreadOperation;

public class ThreadJoin implements Runnable
{
    @Override
    public void run()
    {
        for(int i=0;i<20;i++)
        {
            System.out.println(i+"插队中.....");
        }
    }

    public static void main(String[] args) throws InterruptedException
    {
        ThreadJoin tj=new ThreadJoin();
        Thread thread=new Thread(tj);

        for (int i = 0; i < 50; i++)
        {
            if (i==10)
            {
                thread.start();
                thread.join();
            }
            System.out.println(i+"主线程");
        }
    }
}
